<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>onload</title>
    <script>
        window.onload=function(){
        var an=document.getElementById('an');
        an.onclick=function(){
            an.style.color='red';
        }
        an.ondblclick=function(){
            an.style.color='orange';
        }
        an.onmouseleave=function(){
            an.style.color='blue';
        }}
    </script>
</head>
<body>
    <input type="button" value="点击按钮" id="an">
</body>
</html>